using UnityEngine;
using UnityEngine.UI;
using QFramework;
using UnityEngine.SceneManagement;

namespace ProjectSurvivor
{
	public class UIGamePassPlanelData : UIPanelData
	{
	}
	public partial class UIGamePassPlanel : UIPanel
	{
		protected override void OnInit(IUIData uiData = null)
		{
			mData = uiData as UIGamePassPlanelData ?? new UIGamePassPlanelData();
			// please add init code here

			ActionKit.OnUpdate.Register(() =>//注册帧更新/UI调试回调；
			{
				if (Input.GetKeyDown(KeyCode.Space))
				{
					AudioKit.PlaySound("exp");
					Global.ResetData();//重置战斗相关的临时数据
					this.CloseSelf();
					SceneManager.LoadScene("Game");
					Time.timeScale = 1;
				}
			}).UnRegisterWhenGameObjectDestroyed(gameObject);
			BtnBackToStart.onClick.AddListener(() =>
			{
				AudioKit.PlaySound("exp");
				this.CloseSelf();
				SceneManager.LoadScene("TestGameStart");
			});
			AudioKit.PlaySound("gamepass");
		}
		
		protected override void OnOpen(IUIData uiData = null)
		{
		}
		
		protected override void OnShow()
		{
		}
		
		protected override void OnHide()
		{
		}

		protected override void OnClose()
		{
			
		}
	}
}
